   let data = new Date()

   function zhou() {

       let aa = data.toLocaleString()
       let c = aa.slice(0, 9)
       return c
   }
   let xing = data.getDay()
   if (xing === 0) {
       xing = '日'
   } else if (xing === 1) {
       xing = '一'
   } else if (xing === 2) {
       xing = '二'
   } else if (xing === 3) {
       xing = '三'
   } else if (xing === 4) {
       xing = '四'
   } else if (xing === 5) {
       xing = '五'
   } else if (xing === 6) {
       xing = '六'
   }

   function getMonthFirstDayWeek(year, month) {
       const d = new Date();
       d.setFullYear(year);
       d.setMonth(month);
       d.setDate(1);
       return d.getDay();
   }

   function getMonthDayTotal(year, month) {
       const nextMonth = month + 1;
       const d = new Date(year, nextMonth, 0);
       return d.getDate();
   }


   function weekNum(employTime) {
       let weekTxt = '';
       const month = parseInt(employTime.slice(5, 7), 10);
       const jsMonth = parseInt(employTime.slice(5, 7), 10) - 1;
       const year = parseInt(employTime.slice(0, 4), 10);
       const day = parseInt(employTime.slice(8, 10), 10);
       const startDay = getMonthFirstDayWeek(year, jsMonth); // 该月的1号 星期几
       let monthMondy = '';
       let val = 1;
       if (startDay === 0) { // 1号是星期天
           if (day === 1 && jsMonth === 0) {
               const total2 = getMonthDayTotal(year - 1, jsMonth - 1);
               val = Math.ceil((total2 - 1) / 7);
           } else if (day === 1 && jsMonth > 0) {
               const startDay3 = getMonthFirstDayWeek(year, jsMonth - 1);
               const total2 = getMonthDayTotal(year, jsMonth - 1);
               val = Math.ceil((total2 - 1) / 7);
           }
       } else if (startDay === 1) { // 1号是星期一，正好从该天算起
           val = Math.ceil(day / 7);
       } else { //
           monthMondy = 7 - startDay + 2;
           if (day < monthMondy) {
               if (jsMonth === 0) {
                   const total2 = getMonthDayTotal(year - 1, jsMonth - 1);
                   const startDay2 = getMonthFirstDayWeek(year - 1, jsMonth - 1);
                   val = Math.ceil((total2 - startDay) / 7);
               } else {
                   // 获取上一个月的第一周开始的日期
                   const total2 = getMonthDayTotal(year, jsMonth - 1);
                   const startDay2 = getMonthFirstDayWeek(year, jsMonth - 1);
                   val = Math.ceil((total2 - startDay) / 7);
               }
           } else {
               val = Math.ceil((day - (7 - startDay)) / 7);
           }
       }
       weekTxt = `第${val}周`;
       return weekTxt;
   }


   let week = weekNum(zhou())
   let cook = document.querySelectorAll('.cook .cook-w1')
   let cookk = document.querySelector('.cook')
   let money = document.querySelector('.money-w1')
   let time = document.querySelector('.time-w1')
   let timeXing = document.querySelector('.time-w2')
  
  
   let body = document.querySelector('body')

   money.innerHTML = 100
   time.innerHTML = week
   timeXing.innerHTML = `星期${xing}`
  
   

function hhhhh(qindchu){
        let div = document.createElement('div')

        div.innerHTML = ` <div class="pop-up-w2">
            <div class="pop-up">
                <span class="pop-up-w1">关闭</span>

            </div> 
        </div>`

        body.appendChild(div)

        let pop = document.querySelector('.pop-up')
        let up = document.querySelector('.pop-up-w1') 
        let zheZaoCeng = document.querySelector('.pop-up-w2')

         
        up.addEventListener('click', function () {
            pop.classList.add('dianjin')
            zheZaoCeng.classList.add('dianjin')

         

            body.removeChild(div)
            clearTimeout(qindchu)
    
        })
    }

 

if (sessionStorage.getItem("isReload")) {
    console.log("页面被刷新");

} else {
    console.log("首次被加载");

 let qindchu = setTimeout(()=>{
    
     hhhhh(qindchu) 
    },3000)
     
    sessionStorage.setItem("isReload", true)

}
    
// console.log(cook);
 
cookk.addEventListener('click',( )=>{
    if (cookk.children.length > 5) return
        let div = document.createElement('div')

        div.innerHTML = `<div class="cook-w1"><img src="./img/iconfinder_Chef-2_379358.png" alt=""></div>`

       
    
 
       cookk.appendChild(div)
        


})

         
    




